﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Default.Master" Inherits="System.Web.Mvc.ViewPage<WebStickyNotes.Models.HomeViewProjectModel>" %>
<%@ Import Namespace="WebStickyNotes.Resources" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Labels.PageTitleViewProject %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% foreach (var swimLane in Model.TaskSwimLanes) { %>
    <article class="swimlane" id="Stream_<%= swimLane.TaskStream.Id%>">
        <header>
            <h3><%= Html.ActionLink(swimLane.TaskStream.Title, "TasksForStream", "TaskDetail", new { id = swimLane.TaskStream.Id }, null)%></h3>
        </header>
        <section>
            <% if (!swimLane.TaskStream.ShowTasks) { %>
                <p class="center"><%= string.Format(Labels.HiddenTasks, swimLane.TaskCount) %></p>
            <% } %>
            <% foreach (var taskDetail in swimLane.TaskDetails) { %>
            
            <% if (Model.CurrentUser.TaskRoleId == 1 || Model.CurrentUser.Id == taskDetail.Person.Id) {%>
            <article class="stickynote" id="Task_<%=taskDetail.Task.Id %>">
            <% } else {%>
            <article class="staticnote" id="Task_<%= taskDetail.Task.Id %>">
            <% }%>
                <% Html.RenderPartial("TaskHeader", taskDetail); %>
                <section title="<%= taskDetail.Task.Description.Replace("\"", "\'") %>">
                    <p><%= Labels.TaskPerson %> <span><%= taskDetail.Person.FirstName %> <%= taskDetail.Person.LastName %></span></p>
                    <p><%= Labels.TaskPriority %> <span><%= taskDetail.Priority.Title %></span></p>
                    <p><%= Labels.Release %> <span><%= taskDetail.Task.Release %></span></p>
                    <p><%= Labels.MilestoneDate %> <span><%= taskDetail.Task.MilestoneDate.ToString("dd/MM/yyyy") %></span></p>
                    <% Html.RenderPartial("Progress", taskDetail); %>
                </section>
            </article>
            <% } %>
        </section>
    </article>
    <% } %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        var updateAddress = "<%= Url.Content("~/TaskDetail/MoveTask") %>";
        var progressAddress = "<%= Url.Content("~/TaskDetail/UpdateProgress") %>";
        var inlineEditAddress = "<%= Url.Content("~/TaskDetail/AjaxEdit") %>";
    </script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/ViewProject.js") %>"></script>
</asp:Content>